package test0928.distinct;

public class Dis {
    public static void main(String[] args) {
        int[] arr={1,1,2,2,2,2,3,4,4,5,6,7,7,8,9,10};
        int n=arr.length;
        dis(arr,n);
    }

    static void dis(int[] arr,int n) {
        for(int i=0;i<n-1;i++){
            for (int j=i+1;j<n;j++){
                if(arr[i]==arr[j]){
                    for (int k=j;k<n-1;k++){
                        arr[k]=arr[k+1];
                    }
                    n--;
                    j--;
                }
            }
        }
        for (int i=0;i<n;i++){
            System.out.print(arr[i]+" ");
        }
    }
}
